<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>
        //提取数字
        const str = `
        <ul>
            <ol>
                <a>monday</a>
                <p>3.15</p>
            </ol>
            <ol>
                <a>tuesday</a>
                <p>3.16</p>
            </ol>
            <ol>
                <a>wednesday</a>
                <p>3.17</p>
            </ol>
        </ul>`
        //.*?有换行符的作用
        const req = /<ol>.*?<a>(.*?)<\/a>.*?<p>(.*?)<\/p>/gs
        //const res1 = req.exec(str)
        //console.log(res1)
        result = []
        let res = 0
        while (res = req.exec(str)){
            result.push({
                data:res[1],
                decri:res[2]
            })
        }
        console.log(result)

    </script>
</body>
</html>